package xml;

import java.util.ArrayList;
import java.util.ListIterator;

public class TagXML {
	public TagXML father = null;
	public ArrayList<TagXML> taguri = new ArrayList<TagXML>(); 
	public ArrayList<Attribute> atribute = new ArrayList<Attribute>();
	public String name = null;
	public String value = null;
	public Attribute atribAdder = new Attribute();
	public DeleteAttribute atribDeleter = new DeleteAttribute();
	public AddTag tagAdder = new AddTag();
	public DeleteTag tagDelete = new DeleteTag();
	
	public void setName(String in){ 
		this.name = in;
	}
	public ArrayList<TagXML> getTaguri(){
		return this.taguri;
	}
	public ArrayList<Attribute> getAttribute(){
		return this.atribute;
	}
	public String getValue(){
		return this.value;
	}
	public void setValue(String value){
		this.value = value;
	}
	public TagXML(){
		
	}
	public TagXML(TagXML father){
		
	}
	public TagXML(TagXML father, String name, String value){
		
	}
	public TagXML(TagXML father, String name){
		
	}
	public TagXML(String name){
		
	}
	public TagXML(String name, String value){
		
	}
	public void addAttrib(Attribute a){
		this.atribute.add(a);
	}
	public void deleteAttrib(Attribute a){
		this.atribute.remove(a);
	}
	public void addSonAttrib(Attribute a, TagXML t){
		ListIterator li = atribute.listIterator();
		while(li.hasNext()){
			if (((TagXML)li.next()).equals(t)){
				li.add(a);
			}
		}
	}//not sure
	public void deleteSonAttrib(Attribute a, TagXML t){
		ListIterator li = atribute.listIterator();
		while(li.hasNext()){
			if (((TagXML)li.next()).equals(t)){
				li.remove();
			}
		}
	}//not sure
	public void addTag(TagXML t){
		this.taguri.add(t);
	}
	public void deleteTag(TagXML t){
		this.taguri.remove(t);
	}
	
}
